home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 September
/
PCWorld_2006-09_cd.bin
/
v cisle
/
samurize
/
samurize_1.64.exe
/
plugins
/
hello_world.dpr
< prev
next >
Wrap
Text File
|
2004-03-12
|
986b
|
44 lines
library hello_world;
//Procedure that is given control over some objects to define the DLL usage and functions
function Init():PChar;stdcall;
begin
Result:= 'helloworld';
end;
//Procedure to Init the parameters of a function
Function getparam(func: PChar):PChar;stdcall;
begin
if func = 'helloworld' then begin
Result := '';
end;
end;
function helloworld:PChar;stdcall;
var
final: string;
begin
//ok if your function returns a var it must be done like that
//unlike the ini where you directly type the text you want to be returned,
//it will not work for string vars or even if you do Result:= Pchar(...)
//so be sure to alloc then copy it will work fine
final :='Hello World from a Delphi DLL!';
Result := Pchar(final);
end;
exports Init name 'init';
exports getparam name 'getparam';
exports helloworld name 'helloworld';
//here the exports names must match the ones you sended to samurize
begin
end.